Program test method

ABSTRACT

A METHOD OF ANAYZING COMPUTER PROGRAMS WHICH ARE TO BE TESTED. THE METHOD DETERMINES THE DATA FLOW PATTERNS THROUGH A PROGRAM AND USES THE DATA FLOW PATTERNS TO IDENTIFY A SET OF PATHS IN THE PROGRAM WHICH MUST BE EXERCISED IN ORDER TO VARIFY A PROGRAM&#39;&#39;S CORRECTNESS. THE METHOD INCLUDES THE STEPS OF: PARTITIONING THE PROGRAM SOURCE STATEMENTS INTO GROUPS (EACH OF WHICH ALWAYS EXECUTES AS A SERIAL UNIT, I.E. SERIT), DETERMINING THE EXECUTION SEQUENCES OF THE DIFFERENT SERIAL UNITS, DETERMINING THE DATA INPUT AND OUTPUT ACTIVITIES OF THE SERIAL UNITS ACROSS THEIR BOUNDARIES AND THE PROGRAM BOUNDARIES, LOCTING THE SOURCES OF INPUT DATA TO EACH SERIAL UNIT, AND IDENTIFYING TEST PATHS THROUGH THE PROGRAM SUCH THAT EVERY FIRST-ORDER DEPENDENCY (EACH DIRECT SOURCE OF AN INPUT DATA ITEM PROVIDED TO EACH SERIAL UNIT) IS EXERCISED BY TEST DATA DESIGNED TO EXERCISE THIS SET OF TEST PATHS. THE METHOD CAN BE APPLIED TO PROGRAMS WRITTEN IN DIFFERENT PROGRAMMING LANGUAGES.

srsusiy lJ'LiCA'iiON UNITED STATES PATENT AND TRADEMARK OFFICE Published at the request of the applicant or owner in accordance with the Notice of Dec. 16, 1969, 869 0.G. 687. The abstracts of Defensive Publication applications are identified by distinctly numbered series and arearranged chronologically. Theheading of each abstract indicates the number of pages of specification, including claims and sheets of drawings contained in the application as originally filed. The files of these applications are available to the public for inspection and reproduction may be purchased for 30 cents a sheet.

Defensive Publication applicationshave not been examined as to the merits of alleged invention. The Patent and Trademark Office makes no assertion as to the novelty of the disclosed subject matter.

PUBLISHED ()CTOBER 7, 1975 T93,010 PROGM TEST METHOD Richard Anthony Bender, Hyde Park, and Earl Lee Pottortl, Poughkecpsie, N.Y., assignors to International Business Machines Corporation, Armonk, N.Y. Continuation of application Ser. No. 249,650, May 2,

1972. This application Mar. 25, 1974, Ser. No. 454,047

lint. Cl. Gilet 11/04, 9/06; G05b 17/02 US. Cl. 4441 26 Sheets Drawing. 127 Pages Specification A method of analyzing computer programs which are to be tested. The method determines the data flow patterns through a program and uses the data flow patterns to identify a set of paths in the program which must be exercised in order to verify a programs correctness. The method includes the steps of: partitioning the program source statements into groups (each of which always executes as a serial unit, i.e. serit), determining the execution sequences of the difierent serial units, determining the data input and output activities of the serial units across their boundaries and the program boundaries, locating the sources of input data to each serial unit, and identifying test paths through the program such that every first-order dependency (each direct source of an input data item provided to each serial unit) is exercised by test data designed to exercise this set of test paths. The method can be applied to programs Written in different programming languages.

Oct. 7, 1975 RA. BENDER PROGRAM TEST METHOD Original Filed Mar. 25, 1974 FIG.1

( ENTRY VARJ Sheet 1 of 26 VAR.2

Oct. 7, 1975 RA. BENDER PROGRAM TEST METHOD Sheet 2 of 26 Original Filed Mar. 25, 1974 FIG. 2B

FlG. 2A

ENTRY ENTRY VAR.

VAR. 1

VAR.4

VAR-2 VAR.2 \D

EXIT

EXIT

Oct. 7, 1975 RA. BENDER T939,010

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 3 of 26 FIG.3A FIG. 3B

( ENTRY v ENTRY VAR. 2 E VAR. 2

} VAR.4 VAR.4 .J

---0 VAR.2 \D VAR.2 f

Get. 7, 1975 RA. BENDER T939,010

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 4 of 26 HQ 4 (SERIT FLOWCHART) N EXIT XXXXX Oct. 7, 1975 RA. BENDER T939,010

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 5 of 26 FIG. 5A (PROGRAM FUNCTION) INPUT OUTPUT DATA PROGRAM DATA FIG. 5 B

(TRANSFORMATION BY PROGRAM INSTRUCTIONS) PROGRAM INSTRUCTIONS PROD.

TOTAL= PROD.*2 ADO I TOTAL *2 REPL=AOD I rSET SAVE=ANS.* MEN. SAVE Oct. 7,

RA. BENDER Original Filed Mar. 25, 1974 Sheet 6 of 26 (PROCESS OVERV'EW) OEOLAREO BRANCH SERIT l6 6 TABLE I" TABLE 3 J l MET1H0D A y PROGRAM L, SERITING SERIT LTsTLRO THE PROGRAM CONNECTION TABLE METROO 2 L I SUMMARIZING DECLARED SUMMARY U0 TABLE THE I/O AMALYsLs TABLE METMOO 3 ,1 AMALvzTMc smurf OEPEMOEMOY DEPENDENCIES METHOD 4 L II GENERATING DEPENDENCY I TEsT PATHS I Q g pRoiR M T ENVIRONMENT SPECIFICATION G A EST CASES s|MuLAT|OM VERIFICATION REDESIGN OEOLAREO RRAMOM TABLE OEOL, T/O TABLE LOC.0F LO0.0E O BR. +L=TOTs. TGT.4 TOT.2 TGT.rL O ST INPUHS) OUTPUHS) LA LAST Oct. 7, 1975 RA. BENDER T939,01O

I PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 7 of 26 FIG, 7 (METHOD 1: SERITING OVERVIEW) START T PROGRAM T LISTING SUBMETHODI FINDING THE I BRANCHES AND BRANCH TARGETS A (SEE F|G.7.|)

7-3 SUBMETHODIE GENERATING THE SERIT CONNECTION TABLE (SEE SIG, 7.3)

7-4 M THODTTE SUB E 7-12 SERITTNG THE PROGRAM LISTING H SERIT CONNECTION (SEE FIG. 7.4)

SERITED PROGRAM LISTING TARGET LOC, TABLE(T-5) BR. LOC. TABLE (7-5) BRANCH TABLE (T-6) I 0 LOT). OF TARGET 0 L00. 0F BRANCH 0 LOC.0FBRTfTGTSLTGT1LTGTZTTGTn 1 1 1 2 E: 2' 2 z: 2 :2 LAST LAST LAST SERIT TABLE (7-?) SERIT NAME SERTT START LOC.SERIT ENDLOC. LOCTC FLOW Oct. 7, 1975 RA. BENDER T939,01O

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 8 of 26 FIG 71 (METHOD 1|,SUBMETHOD I=F|ND|NG BRANCHES a BRANCH TARGETS) RECORD TGTLSLOFEXTN 7H INITIALIZE mm m. LOG/TABLE,

\ TABLES 1-5: AND COPY EXTN. ENTRIES TABLE 7-6 FROM DECL. BR. TBL. INTO BR.TABLE.

I I 'T SORT m READ NEXT INPUT 71 STATEMENT E L00. TABLE FROM LISTING T 7.1-9 7H ELIMINATE END OF REDUNDANT usTmc mm COMPRESS m. L00. TABLE l5 STATEMENT A BRANCH 60 T0 METHOD 1, SUBMETHOD IL 1.1-5 TYEs PLACE L00. 0F T0 F|G.7.2

BRANCH m BR. LOC.TABLE 7-5 GET TGT. LOCTSL GE T TGT.

FROM INPUT LOC(S). FROM DECL.

STATEMENT BR. TABLE PLACE LOCATIONLS) 0F TARGETLS) LN TGT. L00.

TABLE 7-5 STORE ENTRY IN BR. TABLE 7-6 Oct. 7, 1975 RA. BENDER T939,010

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 9 of 26 FTG. 7. 2 (METHOD 1, SUBMETHOD 1I= GENERATING THE SERIT TABLE) ENTER FROM METH.2,

SUBMETHOD I FROM FIG.7.1

LNTTTALTZE SERIT TABLE & SET"SERIT NANE CTR,"=1

lNlTlALlZE POINTERS T0 FIRST ENTRIES IN TGT. LOG. TABLE,BR.LOC.TABLE, &

SET"SER|T END LOC."NEXT "L00. OF TGT."- 1

\TZ-S SET"SER|T END Loof= INCREMENT POINTER To "LOC.0F BR." NEXT ENTRY IN TGT.LOC.

L TABLE 7.2-9

FIND L00. OF NEXT BR.\

NEXT TGT. L00.

MARK END OF GO TO METHOD 1, SERIT TABLE SUBMETHOD IE To FIG. 7.3

INCREMENT POINTER T0 NEXT ENTRY IN SERIT TABLE -7.2|4

Oct. 7, 1975 RA. BENDER T939,01O

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 10 of 26 PEG 7,3 (METHOD 1 SUBMETHOD ITII GENERATING THE SERIT coN N ECTION TAB LE I ENTER FROM FRQM METHOD 1 FIG. T2 UBEHOD JI IN IT IALIzE SERIT sET POINTER T.5-24

CONNECTION TO TOP OF TABLE AREA AND sERIT TABLE sET PTRS. T0 20 START OF EAcII TABLE SET CURRENT TGT. sERIT T READ 3 2 HELD= EXIT BRANCH TABLE TABLE I 3 ()F|(; T4 INCREMENT T POINTER To so To NEXT sERIT METHOD I TABLE ENTRY SUBMETHODITI E L 7.5-27 T 3-I3 SET CURRENT TGT.

fi FNIETLTE 3T T 5 28 SET SERIT IT A TGT/ TTTTI INcREIIENT T0 /T.3-29

NEXT RRANcR 7. 3-14 sET TGT. mu 1 NEXT sEouENTIAL sERIT END Loc SERIT NAIIE SET sERIT NAME x x x x x /T.3-15 FOR DEADCODE G I I N E Tg NT T N PTR. To NEXT ENTRY SET SERIT NAME 7 IN sERIT coNIIEcTIoN SERIT NAME OF TABLE cuRRENT SERIT END sERIT CONNECTION TABLE I 7-8 I 1H0 o SER IT NAME TGT. SERIT 1 TGT. SERIT n sET PTR T0 FIRST 1 TGT. OF CURRENT 2 ENTRY IN BRANCH TABLE Q5 LAST Oct. 7, 1975 RA. BENDER T939,010

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 11 of 26 F|G.7. 4 (METHOD I, SUBMETHOD 11: SERITING T HE PROGRAM LISTING I ENTRY FROM METH.1 FROM SUBROUTINE 11 13 I sET POINTER To BEGINNING OF L, SERIT TABLE M \NH READ NEXT INPUT STMT FROM LISTING 7. -4 Z4-5 To FIG. 9.1

CLOSE DATA SET OF SERITEI ESBNENNE I LISTING T. 4-9 T. A-ID 'PRINT STMT- SER IT LOC. sERIT LINE END Loo.

PRINT sTATEIIENT Y 5 T l-42 T 4 READ NExT INPUT sTNT. MARK STATEMENT MARK sTATENENT AS DEAD CODE AS DATA NNIENN STORE INPUT 7. 4-8

sTMT. wITII MARKINGS M PRINT SERIT LINE TNCREMENT POINTER T0 NEXT SERIT TABLE ENTRY Oct. 7, 1975 RA. BENDER T939,01O

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 12 of 26 FIG, 8 (SERIT FLOWCHARTING) ENTER FROM M2 8 II SERIT CONNECTION TABLE FROM M2 ,3 111 UTILITY FORMATING PROGRAM FLOW CHARTING PROGRAM SERIT FLOWCHART FIG,9 (METHOD 2: SUMMARIZTNG OVERVIEW) ENTER FROM M1511 9-3 9-1 SUBMETHOD I I) SERITED ANALYZE PROGRAM STATEMENTS LISTING FOR 1 0 H (FlG.9-1)

I STATEMENT I SUBMETHOD 11 1/0 DECLARED J TABLE A 1 0 T M H/ SUMMARIZING THE 1/0 ANALYSIS m (FIGS. 9.2A as) 7 EXIT T0 METHOD 3 Oct. 7, 1975 RA. BENDER T939,010

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 13 of 26 FIG. 9 1 (METHOD 2, SUBMETHOD I= ANALYZING THE STATEMENTS FOR I/O) ENTER FROM FROM METH. T, suBMET FIG. 7.4

TNITLALTZE POINTER 9 H & WORK AREA FOR sTMT. 1/0 TABLE READ NEXT sTMT.

IN SERITED A2 PROGRAM LTsTINO 9.4-4 STORE COMPLETE STATEMENT m TO FIG. 9.2A

RECORD SERIT NAME IN sTMT.

I/O TBL.

OLR

GET I/O FROM OEcL.

I/O TABLE \\9VT| 9 DETERMINE INPUT/OUTPUT STORAGE AREAS \9 H0 FROM LISTING 9TH) T LRECORD STMT STATEMENT I/() TABLE (9-4 INPUT OUTPUT mpu OUTPUT 0 SERIT NAME STMT. 1* R TLEN--ARTLEN IN sTMT. 4 i 'i TABLE i i 2 i :i i LNOREMENT LAST 5 5 POINTER T 9. L -42 00L 7, 1975 RA. BENDER T939,010

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 14 of 26 (METHOD 2, SUBMETHOD 11 FIQQZA ENTER F OM SUMMARIZING THE I/O METH.2 SUBM.I ANALYSIS) F 054 INITIALIZE WORK FROM 92B AREA FOR SERIT (D I/O SMRY- TBL. & 9.2-4

I INI TIALIZE POINTER READ NExT ENTRY FROM sTIIT. \9 H I/O TABLE 92A T0 FIG 10A STORE sE'RIT I/O Go To INCREMENT SUMMARY TABLE mm 3 PoINTER To NExT As DATA sET 1 SUMMARY TABLE ENTRY AREA 9.2-? mm ENTRY COMPLETE) YEs RECORD SERIT NAME IN SMRY. EN TRY Bz-s 9.2-Io ANY INPuTs IN 1 INcRENENT PoINTER T0 NExT INPIIT VARIABLE IN INPUT ENTRY 9 2-I2 9.2 -45 T0 Rs. 9.28 fi RIOR STMT- RECORD INPUT IN cuRRENT SUMMARY INPUT FIELD Oct. 7, 1975 RA. BENDER PROGRAM TEST METHOD Original Filed Mar. 25, 1974 FIG.9.2B

Sheet 15 of 26 M2,S1I CONT) RECORD OUTPUT lN CURRENT SUMMARY OUTPUT FIELD POINT T0 NEXT OUTPUT VARIABLE SERIT I/O SUMMARY TABLE (9-5) SERIT NAME OUTPUT VARIABLE(S) INPUT VARIABLE-XS) LAST Get. 7, 1975 BENDER PROGRAM TEST METHOD Original Filed Mar. 25, 1974 FROM ENTER FROM M2,S1I FIG.9.2A

Io-I CANDIDATE TABLE Sheet 16 of 26 FIG 10A (METHOD 3: ANALYZING SERIT DEPENDENCY) INITIALIZE WORK AREAS FOR CANDIDATE TABLE & DEPENDENCY TABLE; INITIALIZE POINTERS T0 VARIABLE I/O FLAC COND. FLAC SERIT NAME GROUPINC I FIRST ENTRIES IN EACH WORK AREA & IN SERIT SUMMARY TABLE T }GROUPINC DEPENDENCY TABLE SORT I/O SUMMARY TABLE BY VARIABLE,

& RECORD INTO CANDIDATE INPUT SERIT NAME VARIABLE OUTPUT SERIT NAME CONNECTION PATH TABLE ACCESS CROUPINC FOR NEXT VARIABLE IN CANDIDATE TABLE RECORD DEPENDENCY TABLE AS DATA SET GO TO METH. 4

T0 FIC.I4.IA

ANY REMAINING INPUT SER IT IN CURRENT CROUPING ANY OUTPUT SERIT IN CURRENT CROUPING TO FIC.IOB

SET "ANY" PATH INDICATOR RECORD IN CURRENT DPNDTBLENTRY: "EXTN'.' AS THE OUTPUT SERIT NAME, VARIABLE ,THE INPUT SERIT NAME,&

INCREMENT POINTER FOR DEPENDENCY TABLE Oct. 7, 1975 RA. BENDER T939,01D

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 17 0f 26 FIG. 10 B (METHOD 3 CONT.)

FROM FIG.IOA

SEARCH SERIT CONNECTION TABLE FOR ANY UNDISTURBED PATH FROM EACH PROGRAM ENTRY POINT TO CURRENT INPUT LSERIT IO-I5 RECORD IN CURRENT DPND. TBL. ENTRY="EXTN1' AS OUTPUT SERIT NAME,VARIABLE,INPUT SERIT NAME, & THE CONNECTION PATH UNDISTURBED PATH FOUND FOR CURRENT VARIABLE GET FIRST OUTPUT SERIT ENTRY INCREMENT POINTER 1015 IN CURRENT GROUPING \KHG FOR E DENCY SEARCH SERIT CONNECTION TABLE FOR AN UNDISTURBED PATH FROM THE OUTPUT SERIT TO THE CURRENT INPUT SERIT RECORD IN CURRENT DPND. TABLE ENTRY=THE OUTPUT SERIT NAME, VAR|ABLE,INPUT SERIT NAME &

THE CONNECTING PATH INCREMENT POINTER 1H0 FOR DEPENDENCY TABLE ANY REMAINING OUTPUT SERITS IN CURRENT GROUP Sheet 18 of 26 Original Filed Mar. 25, 1974 525 Qzooww aflfi 2: 22: 5233 g I 1 l I I l i 1 llli' t+ m M 3+ 7 m i W2: N ziww L 1 n P N :w 57: n 0 m2: o a u u N 22: L 5w 5: 5:22: :13 ME 5223 Oct. 7, 1975 RA. BENDER T939,01O

PROGRAM TEST METHOD Original Filed Mar. 25, 1974 Sheet 19 of 26 (5? FIG. 13 (GENERATING TEST PATHS) ERIT FL WCHART s 0 (EXIT CATENATING CONNECTING PATHS DEPENDENCIES PATH1 PATH2 (VAR.1) A(H) D f ABCD (VARJ) H n ABHD (VAR.2) n+r 'ABCDEF (VAR.3) n(r c ABHDEJG (VAR.3) F G YABCDEFG 

